
#include <stdio.h>

long long abs_( long long x )
{
    return ( (x>=0) ? x : (0-x) );
}

int main( int argc, char **argv)
{
    long long x, y, m, n, l;
    long long d, v;
    scanf("%I64d%I64d%I64d%I64d%I64d",&x, &y, &m, &n, &l);

    if(x==y){
        printf("0");
        return 0;
    }

    //Arguement check
    if(x==y || x>2000000000 || y>2000000000 || m<0 || n<0 || m>2000000000 || n>2000000000 || l<0 || l>2100000000)
    {
        printf("Impossible");
        return 0;
    }

    //Impossible to meet;
    if(m==n){
        printf( "Impossible");
        return 0;
    }

    //Can meet;
    v=abs_(m-n);
    if( (x>y && m<n) || (x<y && m>n) )
    {
        d=abs_(x-y);
    }else{
        d=l-abs_(x-y);
    }
    int i=0;
    while(1){
        for(int j=0;j<10000;++j)
        {
            if((j*l+d)%v==0){
                printf("%I64d\n", i);
                return 0;
            }
        }
        i++;
    }
    return 0;
}
